﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		BlogIndexViewData.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System;
using Dexter.DataTransferObject;
using Dexter.Domain.Model;
using Dexter.Domain.Results;
using Dexter.Services;
using Dexter.Web.Mvc.ViewModel.FrontEnd.Binders;
using Dexter.Web.Mvc.ViewModel.ViewsData;
using Dexter.Web.Mvc.ViewsData;
using Dexter.Web.Utils;

namespace Dexter.Web.Mvc.ViewModel.FrontEnd.BlogController {
	public class BlogIndexViewData : PublicBaseViewData {
		CommentBinder binder;
		public BlogIndexViewData ( IWebUtils webUtils , SiteConfiguration configuration , IUrlBuilder urlBuilder ) : base ( webUtils , configuration , urlBuilder ) {}
		public PostDto Post { get; set; }
		public IPagedResult<SearchItem> ReleatedPost { get; set; }

		public CommentBinder Comment {
			get {
				return binder ?? (
				                 	binder = new CommentBinder ( ) {
				                 		Author = base.WebUtils.GetCookieValue ( "Comment_Author" ) ,
				                 		Comment = String.Empty ,
				                 		Email = base.WebUtils.GetCookieValue ( "Comment_Email" ) ,
				                 		Url = base.WebUtils.GetCookieValue ( "Comment_Url" ) ,
				                 	}
				                 );
			}
			set { binder = value; }
		}
	}
}
